package com.cjj.thread;

/**
 * @ClassName ThreadStudy_3
 * @Date 2021/06/27 23:58:49
 * @Created by ccc-j
 * @email ccc-ju@outlook.com
 */
public class ThreadStudy_3 {
    public static void main(String[] args) {
        System.out.println("创建线程成功！");
        // 匿名内部类方式创建线程
        new Thread(new Runnable() {
            @Override
            public void run() {
                for(int i = 0; i < 100; i++){
                    System.out.println("run() i: " + i);
                }
            }
        }).start();
        for(int i = 0; i < 100; i++){
            System.out.println("main() i: " + i);
        }
        System.out.println("创建线程结束！");
    }
}
